<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>Document</title>
	<Css file="__PUBLIC__/Css/style.css"/>
	<js file="__PUBLIC__/Js/jquery-1.7.2.min.js"/>
	<js file="__ROOT__/Data/ueditor/ueditor.config.js"/>
	<js file="__ROOT__/Data/ueditor/ueditor.all.min.js"/>
	<script type="text/javascript">
		window.UMEDITOR_HOME_URL='__ROOT__/Data/ueditor/';
		window.onload=function(){
			window.UEDITOR_CONFIG.initialFrameHeight=600;
			window.UEDITOR_CONFIG.initialFrameWidth=1050;
			// window.UEDITOR_CONFIG.serverUrl='{:U(GROUP_NAME."/Blog/upload")}';
			var ue=UE.getEditor('content');
		}
	</script>
	<if condition="$blog">
		<script type="text/javascript">
			$(function(){
				$('input[name=title]').after('<input type="hidden" name="id" value="{$blog.id}"></input>')
				$('input[name=title]').val('{$blog.title}');
				$('option[value={$blog.cate.id}]').attr('selected','selected');
				<foreach name="blog['attr']" item='v'>
				$('input[value={$v.id}]').attr('checked','checked');
				$('input[name=title]').after('<input type="hidden" name="attr[]" value="{$v.id}"></input>');
				</foreach>
			});
		</script>
		<else/>
		<js file="__PUBLIC__/Js/Public.js"/>
	</if>
</head>
<body>
<form action="{:U(GROUP_NAME.'/Blog/addBlog')}" method="post"  autocomplete="off">
	<section class="widget" style="min-height:300px">
		<header>
			<span class="icon"></span>
			<hgroup>
				<h1>博文发布</h1>
				<h2>创建一篇新文章</h2>
			</hgroup>
		</header>
		<div class="content" style="margin-top: 0px;">
			<div class="field-wrap">
				<input type="text" name="title" value="标题">
			</div>
			<div class="field-wrap">
				<select name="cid" id="" >
						<option value="">===请选择分类===</option>
						<foreach name='cate' item='v' >
							<option value="{$v.id}">{$v.name}</option>
						</foreach>
				</select>
			</div>
			<div class="field-wrap">
				<label>博文属性</label>
					<foreach name='attr' item='v'>
							<input  style="width:20px;" type="checkbox" name="aid[]" id="" value="{$v.id}" />&nbsp;{$v.name}
					</foreach>
			</div>
			<div class="field-wrap">
				<input type="text" name="summary" value="<if condition='$blog'>
						{:htmlspecialchars($blog['content'])}<else/>摘要
					</if>">
			</div>
				<textarea  name="content" id="content" rows="5">
					<if condition="$blog">
						{$blog.content}
					</if>
				</textarea>
		</div>
		<div style="width:56px;height:37px;margin:-20px auto 10px">
	<button  type="submit" class="green">发布</button></div>
	</section>
</form>
</body>
</html>